home *** CD-ROM | disk | FTP | other *** search
/ Storm 1 / Storm I.iso / x35 / users3.rpt < prev    next >
Text File  |  1989-05-23  |  8KB  |  191 lines

  1.      /*******************************************************/
  2.      /* This report script will create an ISAM Data file    */
  3.      /* that can later be copied to USERS.DAT and reindexed.*/
  4.      /* It will set the security level of any user that has */
  5.      /* an upload/download ratio based upon the following   */
  6.      /* table. Users above level 50 are not affected.       */
  7.      /* Note:                                               */
  8.      /*   There is a sort of "fudge factor" built in that   */
  9.      /*   is unavoidable.  That being, a user can download  */
  10.      /*   1 file, upload none, and the ratio will be the    */
  11.      /*   same as 1:1.                                      */
  12.      /*                                                     */
  13.      /* Be sure to change the path statement in the VIRTUAL */
  14.      /* section to match your path to the USERS file.       */
  15.      /*                                                     */
  16.      /* To use the new user file that is created, copy      */
  17.      /* USERS3.TXT to  MAIN\USERS.DAT, delete USERS.IDX,    */
  18.      /* and run GAPREBLD.  Can be placed in an event by     */
  19.      /* using RATIO.BAT included with GAPREPRT.
  20.      /*******************************************************/
  21.  
  22.      /*******************************************************/
  23.      /* All report scripts must begin with START            */
  24.      /*******************************************************/
  25.  
  26. START
  27.  
  28.  
  29.      /*******************************************************/
  30.      /* Virtual fields are used within the report.  They    */
  31.      /* are normally used to provide computations.  For     */
  32.      /* instance, the username field is taking the user's   */
  33.      /* first name and last name, striping off the spaces   */
  34.      /* and then joining the two names together.            */
  35.      /*******************************************************/
  36.  
  37.  
  38. VIRTUAL
  39.  
  40.   userfile      STRING  32      "D:\NODE2\MAIN\USERS.DAT"
  41.   up            SFLOAT   4      uploads   = 0 ? 1.0 : uploads
  42.   down          SFLOAT   4      downloads = 0 ? 1.0 : downloads
  43.   ratio         SFLOAT   4      down / up
  44.  
  45.      /*******************************************************/
  46.      /*                    Table Of Ratios                  */
  47.      /*                                                     */
  48.      /*   Uploads   Downloads   Ratio   Level               */
  49.      /*   -------   ---------   -----   -----               */
  50.      /*      5+         1        0.20     45                */
  51.      /*    2 - 4        1        0.50     40                */
  52.      /*      1          1        1.00     35                */
  53.      /*      1          6        6.00     30                */
  54.      /*      1         11       11.00     25                */
  55.      /*      1         13+      13.00     20                */
  56.      /*******************************************************/
  57.  
  58.  
  59.   level1        INT2     2      (ratio <= 0.20 AND level <= 50)
  60.                                  ? 45 : 0
  61.  
  62.   level2        INT2     2      (ratio >  0.20 AND ratio < 1.00
  63.                                                AND level <= 50)
  64.                                  ? 40 : 0
  65.   
  66.   level3        INT2     2      (ratio >= 1.00 AND ratio < 6.00
  67.                                                AND level <= 50)
  68.                                  ? 35 : 0
  69.  
  70.   level4        INT2     2      (ratio >= 6.00 AND ratio < 11.00
  71.                                                AND level <= 50)
  72.                                  ? 30 : 0
  73.  
  74.   level5        INT2     2      (ratio >= 11.00 AND ratio < 13.00
  75.                                                 AND level <= 50)
  76.                                  ? 25 : 0
  77.  
  78.   level6        INT2     2      (ratio >= 13.00 AND level <= 50)
  79.                                  ? 20 : 0
  80.  
  81.   new_level     INT2     2      level1 + level2 + level3 + level4 +
  82.                                 level5 + level6
  83.  
  84.   user_level    INT2     2      (new_level <> 0) ? new_level : level
  85.  
  86.  
  87.      /*******************************************************/
  88.      /* The SEARCH section is where you tell the report     */
  89.      /* generator how to search the file.  In this case, we */
  90.      /* are searching by the userindex.  The same way you   */
  91.      /* see the users in GAPUSER.                           */
  92.      /*******************************************************/
  93.  
  94.  
  95. SEARCH 
  96.  
  97.   FILE userfile ALL
  98.  
  99.  
  100.  
  101.      /*******************************************************/
  102.      /* The SELECTION section is where you tell the report  */
  103.      /* generator how to select individual records.  For    */
  104.      /* instance, you could tell it to to select ONLY those */
  105.      /* users with a level of 90 or greater.                */
  106.      /*******************************************************/
  107.  
  108.  
  109. SELECT
  110.  
  111.   ALL
  112.  
  113.  
  114.      /*******************************************************/
  115.      /* The sort section allows you to format the report in */
  116.      /* any order you wish.  It must be realized however    */
  117.      /* that in using SORTS, the report generator will need */
  118.      /* to actually sort the data before it prints the      */
  119.      /* report.  This may take some time with large files.  */
  120.      /*******************************************************/
  121.  
  122.      
  123. SORT USING_KEY                      /* format report according to the      */
  124.                                     /* following fields.                   */
  125.   DSC_NO_MOD    sysop               /*  By sysop flag (IMPORTANT!)         */
  126.   DSC_NO_MOD    level               /*  By user level (decending order)    */
  127.   NO_MOD        last                /*  By last name  (ascending order)    */
  128.   NO_MOD        first               /*  By first name (ascending order)    */
  129.  
  130.  
  131.      /*******************************************************/
  132.      /* The DISPLAY section is where you tell the report    */
  133.      /* generator where to send the report.  Output can be  */
  134.      /* directed to any valid DOS device.                   */
  135.      /*******************************************************/
  136.  
  137. DISPLAY
  138.  
  139.   DEVICE        INPFILE     /* INPFILE is an ISAM data file */
  140.   PAGE_WIDTH    652         /* PAGE_WIDTH is record length  */
  141.   PAGE_LENGTH   0           /* no page formatting           */
  142.  
  143.  
  144.      /*******************************************************/
  145.      /* The IMAGE section is where the report is actually   */
  146.      /* produced.   You set up exactly how you want the     */
  147.      /* report to appear, and the report generator will     */
  148.      /* substitute your user or message fields in place of  */
  149.      /* of the format specifications.                       */
  150.      /*                                                     */
  151.      /* Anything after a '+' is printed except that the     */
  152.      /* format specifications are substitued with the       */
  153.      /* actual fields that appear in the line beneath.      */
  154.      /*                                                     */
  155.      /* Inside the body, you may refer to either an actual  */
  156.      /* DODA name, or a name that was defined in the        */
  157.      /* VIRTUAL section above.  For instance, "username"    */
  158.      /* does not exists as one of the DODA names but it was */
  159.      /* defined in the VIRTUAL section as a formula to use  */
  160.      /* "first" and "last" (both defined in DODA)           */
  161.      /*******************************************************/
  162.  
  163.  
  164.      /*******************************************************/
  165.      /*  NOTE!!!  DO NOT place any comments after a line    */
  166.      /*  that begins with a '+'!  If you do, then your      */
  167.      /*  comments will be printed and/or shown!             */
  168.      /*******************************************************/
  169.  
  170.  
  171.  
  172. IMAGE
  173.  
  174. BODY
  175.  
  176. +@D
  177. first last handle city password home_phone data_phone subscription
  178. user_level timeson last_date last_time ttl_mins cur_mins uploads
  179. downloads total_bytes cur_bytes private protocol page_length
  180. last_dir_date last_message messages_read messages_left forums_joined
  181. blts_read doors_opened last_forum expert sysop up_bytes cur_downs
  182. birthdate comment forum1 forum2 forum3 fmes
  183.  
  184.  
  185.      /*******************************************************/
  186.      /* EXIT must be the last line in each script           */
  187.      /*******************************************************/
  188.  
  189.  
  190. EXIT
  191.